<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>添加单机出库单</title>
		<link rel="stylesheet" type="text/css" href="../../css/style.css"/>
		<link rel="stylesheet" type="text/css" href="../../css/form.css"/>
		<link rel="stylesheet" type="text/css" href="../../css/layui.css"/>
	</head>
	<body>
		<!-- 蓝色背景区域 -->
		<div class="wrap">
			<!-- 白色可用区域 -->
			<div class="canuse">
				<!------ 位置 ------>
	            <p class="contentText local">位置：库存日常管理 > 出库管理 > 添加单机出库单</p>
	            
				<!------ tab标签 ------>
	            <!--<div class="layui-tab layui-tab-card">
				    <ul class="layui-tab-title">
					    <li class="layui-this">新建出库单</li>
					    <li>审核出库单</li>
				    </ul>
					<div class="layui-tab-content">
					    <div class="layui-tab-item layui-show">-->
					    	
					    	<div class="article_list" style="width: 98.5%; margin: 0px auto;">
					            <!------- 内容 ------->
					            <div class="content content1">
					            	<!-- 用户列表内容区 -->
					                <div class="con con_01">
					                    <!-- 表单信息填写区 -->
					                    <h4 class="sel_title"><img src="../../img/list/brand1.png" /><span>新建单机出库单</span></h4>
					                    <div class="write_area">
					                        <form id="addFrom" action="" method="post">
					                            <table class="contentText" border="1" cellspacing="0" cellpadding="0" width="99%" style="margin-bottom: 10px;">
					                                <tbody>
					                                    <tr>
					                                        <th>出库单号：</th>
					                                        <td><input type="text" name="" value="CKDH20180911101754" readonly="readonly" /></td>
					                                        <th>出库时间：</th>
					                                        <td><input type="text" name="" value="2018-09-11" readonly="readonly" /></td>
					                                        <th>制单人：</th>
					                                        <td><input type="text" name="" value="超级管理员" /></td>
					                                    </tr>
					                                    <tr>
					                                        <th>申领单号：</th>
					                                        <td><input type="text" name="" value="" /></td>
					                                        <th>申领工位：</th>
					                                        <td><input type="text" name="" value="" /></td>
					                                        <th>申领人：</th>
					                                        <td><input type="text" name="" value="" /></td>
					                                    </tr>
					                                </tbody>
					                            </table>
					                        </form>
					                    </div>
					                </div>
									<!-- 列表展示区 -->
									<div class="table_border">
						                <div class="show_list">
						                	<div class="title_operate">
						                    	<h4 class="sel_title"><img src="../../img/list/brand1.png" /><span>二级库物料出库单</span></h4>
						                		
						                        <!-- 操作类型区 -->
						                        <div class="operate_area" id="addOperate">
						                            <a id="addDetail" onclick="addDetail()" class="bgd_add img_hand">增加</a> 
						                             <a   class="bgd_import1 img_hand">导入</a> 
						                            <a id="deleteDetail" onclick="deleteDetail()" class="bgd_delete img_hand">删除</a> 
						                        </div>
						                	</div>
						                	<div class="list_area">
						                        <!-- 信息列表区 -->
						                        <div class="info_area">
						                            <table class="tablelist" border="1" cellspacing="0" cellpadding="0">
						                                <tbody>
						                                    <tr class="menuText list_head">
						                                    	<th class="checkSelectAll"></th>
						                                        <th class="">序号</th>
						                                        <th class="">型号/阶段</th>
						                                        <th class="">图号</th>
						                                        <th class="">名称</th>
						                                        <th class="">代号</th>
						                                        <th class="">批次号</th>
						                                        <th class="">数量</th>
						                                        <th class="">货柜编号</th>
						                                         <th class="">库位号</th>
						                                        <th class="">备注</th>
						                                    </tr>
						                                </tbody>
						                                <tbody class="tablelist" id="addTr">
						                                    <tr class="listTableText list_list">
						                                    	<td><input type="checkbox" class="input_checkBox" name="" id="" value=""></td>
						                                        <td>1</td>
						                                        <td><input type="text" name="" value="" /></td>
						                                        <td><input type="text" name="" value="" /></td>
						                                        <td><input type="text" name="" value="" /></td>
						                                        <td><input type="text" name="" value="" /></td>
						                                        <td><input type="text" name="" value="" /></td>
						                                        <td><input type="text" name="" value="" /></td>
						                                         <!-- <td><select style="width: 100px;"><option>1#货柜</option><option>2#货柜</option></select></td>
				                                      		  <td><input style="width: 60px;" type="text" name="" value="1#" id="kuwei"/>
						                                        	<a onclick="showKW()" class="bgd_blue_two img_hand" style="margin-left:0px;margin-bottom: 0px;">选择</a></td> -->
						                                        <td>2#货柜</td>
				                                      		  <td>1#</td>
				                                      		  <td><input type="text" name="" value="" /></td>
						                                    </tr>
						                                </tbody>
						
						                            </table>
						                        </div>
						                        <div class="mask hidden" id="stockNumber">
				<div class="printDiv">
					<h4 class="printTitle">
						库位选择
						<img onclick="$('#stockNumber').hide();" src="../../img/list/delete.png"/>
					</h4>
					<div class="info_area" id="stockNumberList">
						 <table class="tablelist" border="1" cellspacing="0" cellpadding="0">
						 	<tbody>
						        <tr class="menuText list_head">
							 		<td>1#</td>
							 		<td>2#</td>
							 		<td>3#</td>
							 		<td>4#</td>
							 		<td>5#</td>
							 		<td>6#</td>
							 		<td>7#</td>
							 		<td>8#</td>
							 		<td>9#</td>
							 		<td>10#</td>
							 	</tr>
							 	<tr class="menuText list_head">
							 		<td>11#</td>
							 		<td>12#</td>
							 		<td>13#</td>
							 		<td>14#</td>
							 		<td>15#</td>
							 		<td>16#</td>
							 		<td>17#</td>
							 		<td>18#</td>
							 		<td>19#</td>
							 		<td>20#</td>
							 	</tr>
							 	<tr class="menuText list_head">
							 		<td>21#</td>
							 		<td>22#</td>
							 		<td>23#</td>
							 		<td>24#</td>
							 		<td>25#</td>
							 		<td>26#</td>
							 		<td>27#</td>
							 		<td>28#</td>
							 		<td>29#</td>
							 		<td>30#</td>
							 	</tr>
						 	</tbody>
						 </table>
					</div>
				</div>
			</div>
						                        <!-- 确定按钮 -->
						                        <div class="certainBtn">
						                        	<a href="" class="bgd_blue_two img_hand">确定</a> 
						                            <a href="outstockList.html" class="bgd_white_two img_hand">返回</a> 
						                        </div>
						                        <!-- 页码区域 -->
							                    <!--<div class="page_area contentText clear">
							                    	<div class="page_sum">
							                    		共<span class="page_number"> 3 </span>页&emsp;每页 10 条&emsp;共<span class="info_sum"> 27 </span>条记录
							                    	</div>
							                        <div class="page-pull-right async-page">
							                            <button>首页</button>
							                            <button>&lt;&lt;</button>
							                            <button class="select_page">1</button>
							                            <button>2</button>
							                            <button>3</button>
							                            <button>&gt;&gt;</button>
							                            <button>尾页</button>
							                        </div>
							                    </div>-->
						                    </div>
						                </div>
									</div>
					            </div>
					        </div>
			</div>
			
			<!-- 版尾  -->
			<div class="ending">
				Copyright© 2019-2020磐基技术有限公司
			</div>
		</div>
	</body>
	<script src="../../js/jquery-3.1.1.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="../../js/layui.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript">
		var h = document.documentElement.clientHeight;
		$(".wrap").css("height", h);
		
		// 获取每行 td 的兄弟节点
		$("#metailInfo td").hover(   
			function () {      
				$(this).parent().children().addClass("td_hover");
			},    
			function () {      
				$(this).parent().children().removeClass("td_hover");  
			}
		);
		
		//-------- 增加明细 ---------
	    function addDetail() {
	        var trInt = $("#addTr").find("tr").length;
			var no = trInt + 1;// 序号
			
	        var dom = "<tr class='contentText list_list'><td><input type='checkbox' class='input_checkBox' name='' id='' value=''></td>";
	        dom += "<td>" + no + "</td>";
	        dom += "<td><input type='text' name='' value=''></td>";
	        dom += "<td><input type='text' name='' value=''></td>";
	        dom += "<td><input type='text' name='' value=''></td>";
	        dom += "<td><input type='text' name='' value=''></td>";
	        dom += "<td><input type='text' name='' value=''></td>";
	        dom += "<td><input type='text' name='' value=''></td>";
	        dom += "<td><input type='text' name='' value=''></td>";
	        dom += "<td><input type='text' name='' value=''></td>";
	        dom += "<td><input type='text' name='' value=''></td></tr>";
	        
	        $("#addTr").append(dom);
	    }
		
		//-------- 删除明细 ---------
	    function deleteDetail() {
	        var checks = $("input[type='checkbox']:checked");
	        if (checks.length == 0) {
	            $("#addTr").find("tr:last").remove();
	        } else {
	            $.each(checks, function(item, obj) {
	                $(obj).parent().parent().remove();
	            });
	        }
	    }

		layui.use('element', function(){
			var $ = layui.jquery, 
			    element = layui.element; //Tab的切换功能，切换事件监听等，需要依赖element模块
			  
		    //触发事件：添加、删除、切换
		    var active = {
			    tabAdd: function(){
			        //新增一个Tab项
			        element.tabAdd('demo', {
			        	title: '新选项'+ (Math.random()*1000|0), 
			        	content: '内容'+ (Math.random()*1000|0),
			        	id: new Date().getTime() //实际使用一般是规定好的id，这里以时间戳模拟下
			        })
			    },
			    tabChange: function(){
			        //切换到指定Tab项
			        element.tabChange('demo', '22'); //切换到：“用户管理”
			    }
		    };
		  
		    $('.site-demo-active').on('click', function(){
		    	var othis = $(this), 
		        	type = othis.data('type');
		    	active[type] ? active[type].call(this, othis) : '';
		    });
		  
		    //Hash地址的定位
		    var layid = location.hash.replace(/^#test=/, '');
		    element.tabChange('test', layid);
		  
		    element.on('tab(test)', function(elem){
		   		location.hash = 'test='+ $(this).attr('lay-id');
		    });
		});
		function showKW(){
	    	$("#stockNumber").show();
	    }
		
		$("#stockNumberList td").hover(   
			function () {      
				$(this).addClass("td_hover");
			},    
			function () {      
				$(this).removeClass("td_hover");  
			}
		);
		
		$("#stockNumberList td").click(
			function(){
				var a = $(this).html();
				$("#kuwei").val(a);
				$("#stockNumber").hide();
			}
		)
	</script>
</html>
